<template>
<view>
<block v-if="info!=''&&info!=null">
	<view class="info_box">
		<view class="in_tit">{{info.title}}</view>
		<view class="time_box">发布时间：{{info.createtime}}</view>
		<view class="in_word">{{info.content}}</view>
		<view class="n_tel_box"><label>联系人：{{info.name}}</label><label class="lab_tel">联系电话：{{info.tel}}</label></view>
    <view class="in_word">地址：{{info.address}}</view>
	</view>
</block>
</view>
</template>

<script>
var app = getApp(),
    upurl = app.globalData.util.url("entry/wxapp/Api", {
  m: "monai_market",
  uid: wx.getStorageSync("uid"),
  r: "Upimg"
});

export default {
  data() {
    return {
      aid: '',
      wh: '',
      info: ''
    };
  },

  components: {},
  props: {},

  /**
   * 生命周期函数--监听页面加载
   */
  onLoad: function (options) {
    var that = this;
    that.setData({
      aid: options.id,
      wh: options.wh
    });

    if (options.wh == 1) {
      wx.setNavigationBarTitle({
        title: '找工作详情'
      }), that.getInfoDet();
    } else if (options.wh == 2) {
      wx.setNavigationBarTitle({
        title: '租赁详情'
      }), that.getInfoDet();
    } else if (options.wh == 3) {
      wx.setNavigationBarTitle({
        title: '找工作详情'
      }), that.getUserDet();
    } else {
      wx.setNavigationBarTitle({
        title: '租赁详情'
      }), that.getUserDet();
    }
  },

  /**
   * 生命周期函数--监听页面初次渲染完成
   */
  onReady: function () {},

  /**
   * 生命周期函数--监听页面显示
   */
  onShow: function () {},

  /**
   * 生命周期函数--监听页面隐藏
   */
  onHide: function () {},

  /**
   * 生命周期函数--监听页面卸载
   */
  onUnload: function () {},

  /**
   * 页面相关事件处理函数--监听用户下拉动作
   */
  onPullDownRefresh: function () {},

  /**
   * 页面上拉触底事件的处理函数
   */
  onReachBottom: function () {},

  /**
   * 用户点击右上角分享
   */
  onShareAppMessage: function () {},
  methods: {
    //获取用户自己的找工作或租赁详情
    getUserDet: function () {
      var that = this;
      app.globalData.util.request({
        url: "entry/wxapp/Api",
        data: {
          r: "home.index.user_workrentdetial",
          m: "monai_market",
          id: that.aid,
          uid: app.globalData.getuid()
        },
        cachetime: "0",
        success: function (a) {
          console.log('自己详情返回：', a.data);
          that.setData({
            info: a.data.data
          });
        }
      });
    },
    //获取平台找工作或租赁详情
    getInfoDet: function () {
      var that = this;
      app.globalData.util.request({
        url: "entry/wxapp/Api",
        data: {
          r: "home.index.pt_workrentdetial",
          m: "monai_market",
          id: that.aid
        },
        cachetime: "0",
        success: function (a) {
          console.log('平台详情返回：', a.data);
          that.setData({
            info: a.data.data
          });
        }
      });
    }
  }
};
</script>
<style>
@import "./jobDet.css";
</style>